<% breadcrumb :recommends %>

<div class="row">
  <div class="col-lg-12">
    <div class="ibox float-e-margins">
      <div class="ibox-title">
        <h5>推荐列表</h5>
      </div>
      <div class="ibox-content">
        <div class="project-list">

          <div class="row">
            <div class="col-sm-12">
              <%= link_to '新增推荐', new_event_recommend_path, class: 'btn btn-white btn-sm pull-right' %>
            </div>
          </div>

          <div class="row">

          <table class="table table-hover">
            <thead>
              <th>推荐分类</th>
              <th>店名</th>
              <th>地址</th>
              <th>电话号码</th>
              <th>距离</th>
              <th>操作</th>
            </thead>
            <tbody>
            <% @recommends.each do |recommend| %>
            <tr>
              <td><%= recommend.category_name %></td>
              <td><%= recommend.recommend_name %></td>
              <td><%= truncate(recommend.address, :length=>20)%></td>
              <td><%= recommend.phone_number %></td>
              <td><%= recommend.distance %>km</td>
              <td>
                <%= link_to edit_event_recommend_path(current_event, recommend), class: 'btn btn-white btn-sm' do%>
                <i class="fa fa-pencil"></i> 修改
                <% end %>

                <%= link_to event_recommend_path(current_event, recommend), method: :delete, data: {confirm: '是否确认删除？'}, class: 'btn btn-white btn-sm' do %>
                  <i class="fa fa-trash"></i> 删除
                <% end %>
              </td>
            </tr>
            <% end %>

            </tbody>
          </table>
          </div>
        </div>

      </div>
    </div>
  </div>
</div>
